package org.zhuyx.ch01.shili.service.impl;

import org.zhuyx.ch01.factory.PetDaoFactory;
import org.zhuyx.ch01.shili.dao.PetDao;
import org.zhuyx.ch01.shili.entity.Pet;
import org.zhuyx.ch01.shili.service.PetService;

/**
 * @author 茜茜
 * @date 2024-12-05 11:23
 */
public class PetServiceImpl2 implements PetService {
    PetDao petDao= PetDaoFactory.getInstance(PetDaoFactory.defaultBeanName);

    public PetDao getPetDao() {
        return petDao;
    }

    public void setPetDao(PetDao petDao) {
        this.petDao = petDao;
    }

    @Override
    public boolean insert(Pet pet) {
        return petDao.insert(pet)>0;
    }
}
